public class Test {
    public static void main8(String[] args) {
        String str = "ababcabcdef";
        String ret = str.replace('a','p');
        System.out.println(ret);
        String ret2 = str.replace("ab","ssp");
        System.out.println(ret2);
    }
    public static void main7(String[] args) {
        char[] array = {'a','b','c'};
        String s = new String(array);
        System.out.println(s);
        //数组转字符串


    }
    public static void main6(String[] args) {
        int i = Integer.parseInt("123");
        System.out.println(i);
        double d = Double.parseDouble("12.34");
        System.out.println(d);
    }
    public static void main5(String[] args) {
        int a = 123;
        String str = String.valueOf(a);
        System.out.println(str);
        String s4 = String.valueOf(new Student("Hanmeimei", 18));
        System.out.println(s4);
    }
    public static void main4(String[] args) {
        String str = "abcdefg";
        int i = str.lastIndexOf('g');
        System.out.println(i);
        //int lastIndexOf();从后往前找
    }
    public static void main3(String[] args) {
        String str = "abcde";
        System.out.println(str.indexOf("de"));
        //int indexOf(String str) /int indexOf(String str,int fromIndex)
    }
    public static void main2(String[] args) {
        String str = "abcde";
        int i = str.indexOf('c');
        System.out.println(i);
        //int indexOf(int ch) /int indexOf(int ch,int fromIndex)
    }
    public static void main1(String[] args) {
        String str = "abcdef";
        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            System.out.print(ch);
        }
    }//char charAt()方法
}
